package cn.chenfei.jfx;

import javafx.application.Application;

import javafx.scene.Scene;

import javafx.stage.Stage;
import javafx.stage.StageStyle;


/**
 * @author ChenFei
 * @date 2022年4月8日
 */
public class App extends Application {

    private static Scene scene;

    @Override
    public void start(Stage stage) {
        ButtonGroup buttonGroup = new ButtonGroup();
        scene = new Scene(buttonGroup);
        //鼠标箭头样式
        //scene.setCursor(Cursor.cursor(getClass().getResource("img/j.png").toExternalForm()));
        scene.setFill(null);
        //不显示标题栏
        stage.initStyle(StageStyle.TRANSPARENT);
        //设置窗口图标
        //stage.getIcons().add(JFxUtils.getImage("img/avatar.png"));
        stage.setScene(scene);
        //窗口大小不可变
        stage.setResizable(false);
        stage.show();
        //设置窗口放在最上边
        stage.setY(0);
    }

    public static void main(String[] args) {
        launch();
    }

    public static Stage getStage() {
        return (Stage) scene.getWindow();
    }

    public static Scene getScene() {
        return scene;
    }

}